package com.neusoft.databus.policy.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;

import lombok.Getter;
import lombok.Setter;

/**
 * 事件统计信息(热数据)
 * 
 * @author naxiang
 */
@Getter
@Setter
@Entity
public class EventAttribute extends AbstractModel {

    private static final long serialVersionUID = -4509043521413829923L;

    /**
     * 触发次数
     */
    @Min(value = 1, message = "触发次数不能小于{value}")
    @Column(nullable = false)
    private Long count = 0L;//

    /**
     * 事件最近发生时间
     */
    private Date lastTime = new Date();

    /**
     * 事件内容
     */
    @NotBlank(message = "事件内容不能为空")
    @Length(max = 1023, message = "事件内容不能超过{max}位")
    @Column(length = 1023, nullable = false)
    private String content;

}
